package com.xiaowu.netmusic.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 用户表持久化对象
 */
@Data
@TableName("user")  // 指定对应的数据库表名
public class UserPO {

    @TableId(type = IdType.AUTO) // 主键自增
    @Schema(description = "用户ID，自增主键")
    private Long id;

    @Schema(description = "用户名，唯一")
    private String username;

    @Schema(description = "密码")
    private String password;

    @Schema(description = "头像地址")
    private String avatar;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "GitHub账户ID（第三方登录用）")
    private String githubId;  // 👈新增

    @Schema(description = "用户状态（1正常，0禁用）")
    private Integer status;   // 👈新增

    @Schema(description = "逻辑删除标志（0正常，1已删除）")
    private Integer deleted;  // 👈新增

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;
}

